#ifndef GAME_H
#define GAME_H

#include <OgreSceneManager.h>
#include <OgreRenderWindow.h>
#include <vector>
#include <string>
#include <iterator>

#include "DebugTracer.h"

class Player;
class Race;
class Jet;
class Track;
class XML_Loader;
class Game
{
    public:
        Game(Ogre::SceneNode* root);
        virtual ~Game();
        void Update(float timedelta);
        void OnAccelerateKey(float timedelta);
        void OnTurnRightKey(float timedelta);
        void OnTurnLeftKey(float timedelta);
        void OnBrakeKey(float timedelta);
        void OnTurnRightJoystick(float delta);
        void OnTurnLeftJoystick(float delta);
        inline Race* GetRace()
        {
            return m_race;
        }
    protected:
    private:
        unsigned int m_state;
        unsigned int m_lastState;

        Ogre::SceneNode* m_root;

        //boolean determining wheter the 3D scene should be updated or not
        bool m_dirty;

        Race* m_race;

        //needed to separate the game logic from the rendering
        Player* m_player;

};

#endif // GAME_H
